#pragma once

#include "EventQueue.h"
#include "DSEngine.h"
#include "Event.h"
#include "Agent.h"
#include "World.h"
#include "Action.h"
#include <process.h>
#include <vector>

namespace BAA
{
	//Singleton class
	public class AIEngine
	{
	public:
		static AIEngine * getInstance();
		~AIEngine(void);

		void update(float timeElapsed);
		void createEvent( Agent * source, std::vector<Agent*> * targets, 
			int urgency, int priority, Action * action, float range);

		std::vector<Event *> * requestEvents(Agent * requester, float range);

	private:
		void init();
		bool nextAgent(DSEngine * ds, int maxTimeStep);
		float currentTime;

		DSEngine * dsengine;
		EventQueue * eq;
		std::vector<Agent *> agents;
		std::vector<Agent *> running_agents;

		static AIEngine* pInstance;

	protected:
		AIEngine(void);
	};

}